<template>
  <div>
    <div class="title font14 ma30-15">
      <p>未读消息</p>
    </div>
    <div class="pa15 bor7">
          <div class="clearfix">
        <div class="fr details-but">
          <router-link to=""><el-button @click="$router.back(-1)" class="primary1 primary">返回</el-button></router-link>
        </div>
      </div>
      <!-- 内容 -->
      <div class="information-box">
          <div class="information-box-top">
              <p class="font16">{{ defaultInfo.title }}</p>
              <p class="font12">{{ defaultInfo.create_time | formatDate }}</p>
          </div>
          <div class="information-content font12" v-html="defaultInfo.content"></div>
      </div>
    </div>
  </div>
</template>

<script>
import { formatDate } from "../../assets/data.js";
export default {
  // 时间戳
  filters: {
    formatDate(time) {
      time = time * 1000;
      let date = new Date(time);
      return formatDate(date, "yyyy-MM-dd hh:mm:ss");
    },
  },
  data() {
    return {
      defaultInfo: [],
    };
  },
  mounted() {
    this.getInfo();
  },
  methods: {
    handleClick(tab, event) {
      //console.log(tab, event);
    },
    getInfo() {
      var that = this;
      this.$axios
        .get(
          this.$api +
          "//api/message/detail?id="+this.$route.query.id
        )
        .then(function (response) {
          that.defaultInfo = response.data.data;
          //console.log(that.defaultInfo);
        })
        .catch(function (error) {
          //console.log(error);
        });
    },
  },

};
</script>

<style scoped>
html {
  height: 100% !important;
  overflow-y: hidden !important;
}
.information-box-top .font16{
    color: #000;
}
.information-box-top .font12{
    color: #545556;
    margin-top: .5rem;
}
.information-content{
    line-height : 1.125rem;
    color : #9F9FA0;
    padding: .9375rem 0;
    margin: .9375rem 0;
    border-top: 1px solid #E4E7ED;
}
</style>
